<?php
/**
 * 获取微信用户信息
 *
 * Author: Zeon
 * Date: 2018/5/11
 * Created by Panxsoft.
 */
namespace App\Http\Controllers\OpenWechat;

use App\Http\Controllers\ApiController;
use App\Models\OpenWechat\WechatUser;

class WechatUserController extends ApiController
{
    /**
     * @param $openid
     * @return array|\Illuminate\Http\Response
     */
    public function showByOpenid($openid)
    {
        $wechat_user = WechatUser::findByOpenId($openid);
            $this->checkIsTrue($wechat_user, trans('open_wechat.wechat_user', ['wechat_user' =>$openid]));

        return $this->response(compact('wechat_user'));
    }
}
